package nowcoder;
/**
 * 题目ID：69385--字符串中找出连续最长的数字串
 * 链接：https://www.nowcoder.com/practice/bd891093881d4ddf9e56e7cc8416562d?tpId=85&&tqId=29864&rp=1&ru=/activity/oj&qru=/ta/2017test/question-ranking
 */
import java.util.*;
public class Day03_1 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        String str = input.nextLine();

        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < str.length(); i++) {
            char c = str.charAt(i);
            if(Character.isDigit(c)){
                sb.append(c);
            }else{
                sb.append('c');
            }
        }

        String str2 = sb.toString();
        String[] rets = str2.split("c");
        int maxL = 0, maxIndex = 0;
        for (int i = 0; i < rets.length; i++) {
            if(rets[i].length() > maxL) {
                maxL = rets[i].length();
                maxIndex = i;
            }
        }
        System.out.println(rets[maxIndex]);
    }
}
